Skip to content

This should fix the missing option '--output-path' on webpack.#1627

Merged
TheLarkInn merged 3 commits intoangular:masterfrom
not-only-code:bugfix/webpack-output-path
Aug 17, 2016
Merged

This should fix the missing option '--output-path' on webpack.#1627
TheLarkInn merged 3 commits intoangular:masterfrom
not-only-code:bugfix/webpack-output-path

Conversation

@not-only-code
Copy link
Copy Markdown
Contributor

Previous PR to webpack branch: #1595
Related issue: #1569

@TheLarkInn
Copy link
Copy Markdown
Member

@not-only-code can you update your branch with master.

@not-only-code not-only-code force-pushed the bugfix/webpack-output-path branch from 200af15 to 9db0591 Compare August 15, 2016 18:32
@not-only-code
Copy link
Copy Markdown
Contributor Author

@TheLarkInn updated.

let webpackCompiler: any;

var config: NgCliWebpackConfig = new NgCliWebpackConfig(this.project, commandOptions.target, commandOptions.environment).config;
var config: NgCliWebpackConfig = new NgCliWebpackConfig(this.project, commandOptions.target, commandOptions.environment, commandOptions.outputPath).config;
Copy link
Copy Markdown
Member

@TheLarkInn TheLarkInn Aug 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content base property for webpack dev server needs to be set also. This I believe is pulled in from webpack-build-utils or is set when that object is pulled into the serve task.

Copy link
Copy Markdown
Contributor Author

@not-only-code not-only-code Aug 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some research, I saw that setting up contentBase in 'webpack-dev-server' configuration does not bundle the files into the desired folder. So i did use this plugin write-file-webpack-plugin which forces 'webpack-dev-server' to write a bundle folder.

Now ng serve will always output a bundle files (dist/ by default) as system.js did in previous versions.

@not-only-code not-only-code force-pushed the bugfix/webpack-output-path branch from 9db0591 to 8ed71ce Compare August 16, 2016 17:15
@TheLarkInn
Copy link
Copy Markdown
Member

We do not want files emitted for serve. webpack-dev-server serves virtual bundles in memory. Setting content base just ensures that the dev server is point to the correct 'virtual output path' to know how to emulate the output files.

@not-only-code not-only-code force-pushed the bugfix/webpack-output-path branch from 8ed71ce to 8526ae5 Compare August 16, 2016 22:55
@not-only-code
Copy link
Copy Markdown
Contributor Author

Ok, reverted last changes, just added contentBase variable.

@TheLarkInn
Copy link
Copy Markdown
Member

Otherwise you might as well be using ng build with watch flag and additional server setup. In memory fs is really an important build performance feature in this case.

@TheLarkInn
Copy link
Copy Markdown
Member

Perfect no worries and yay for tests we like that!!!!

@not-only-code not-only-code force-pushed the bugfix/webpack-output-path branch from 8794962 to 7cb6919 Compare August 16, 2016 23:36
@not-only-code not-only-code force-pushed the bugfix/webpack-output-path branch from 7cb6919 to 2af0551 Compare August 16, 2016 23:38
@not-only-code
Copy link
Copy Markdown
Contributor Author

Updated.

@TheLarkInn
Copy link
Copy Markdown
Member

LGTM.

@TheLarkInn TheLarkInn merged commit c58c5b3 into angular:master Aug 17, 2016
@TheLarkInn
Copy link
Copy Markdown
Member

Thank you! @not-only-code

@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants